package utility;

/**
 * Keyword class for storing and comparing keywords while tracking hits.
 * @author Daniel Anderson
 * @version TCSS422 2012
 */
public class Keyword {
	
	String my_keyword;
	int my_hits;
	
	public Keyword(String word) {
		my_keyword = word.toLowerCase();
		my_hits = 0;
	}
	
	public String getWord() {
		return my_keyword;
	}
	
	public int getHits() {
		return my_hits;
	}
	
	public void addHit() {
		my_hits = my_hits + 1;
	}
	
	public boolean isWord(String word) {
		return word.toLowerCase().contains(my_keyword);
	}
	
	@Override
	public boolean equals(Object obj) {
		return obj.toString() == my_keyword;
	}

	@Override
	public String toString() {
		return my_keyword;
	}
}
